<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
  <!ENTITY nbsp "&#x00A0;">
]>
<xsl:stylesheet
	version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:msxml="urn:schemas-microsoft-com:xslt"
	xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:umbraco.examine="urn:umbraco.examine" xmlns:Utils="urn:Utils"
	exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbraco.examine Utils ">


  <xsl:output method="xml" omit-xml-declaration="yes"/>

  <xsl:param name="currentPage"/>
  <xsl:param name="rootNode" select="$currentPage/ancestor::Root" />

  <xsl:template match="/">
    <section id="content">
      <div class="container_12">
        <div class="wrapper">
          <xsl:for-each select="$rootNode/child::Intro[@id=$currentPage/@id]">
            <xsl:variable name="highlightContent" select="umbraco.library:GetXmlNodeById(number(mainContent))"></xsl:variable>
            <article class="grid_6">
              <h2 class="p9 border1">
                <xsl:value-of select="$highlightContent/contentTitle"/>
              </h2>
              <div class="">
                <xsl:if test="$highlightContent/contentThumbnail !=''">
                  <a href="{umbraco.library:NiceUrl($highlightContent/@id)}">
                    <figure class="page3-img1">
                      <img src="{Utils:GetImageUrl($highlightContent/contentThumbnail)}" class="mn_homepage_logo" alt="" style="image-align:middle" />
                    </figure>
                  </a>
                </xsl:if>
                <p class="p8">
                  <a class="link2" href="{umbraco.library:NiceUrl($highlightContent/@id)}">
                    <xsl:value-of select="$highlightContent/contentTitle"/>
                  </a>
                  <br/>
                  <xsl:value-of select ="umbraco.library:TruncateString($highlightContent/contentBody, 400,'...')" disable-output-escaping="yes"></xsl:value-of>
                </p>
                <a class="link3" href="{umbraco.library:NiceUrl($highlightContent/@id)}">Ler Mais >></a>
              </div>
            </article>
          </xsl:for-each>
          <xsl:for-each select="$rootNode/child::Intro[@id!=$currentPage/@id]">
            <xsl:variable name="highlightContent" select="umbraco.library:GetXmlNodeById(number(mainContent))"></xsl:variable>
            <article class="grid_6">
              <h2 class="p9 border1">
                <xsl:value-of select="$highlightContent/contentTitle"/>
              </h2>
              <div class="">
                <xsl:if test="$highlightContent/contentThumbnail !=''">
                  <a href="{umbraco.library:NiceUrl($highlightContent/@id)}">
                    <figure class="page3-img1">
                      <img src="{Utils:GetImageUrl($highlightContent/contentThumbnail)}" class="mn_homepage_logo" alt="" style="image-align:middle" />
                    </figure>
                  </a>
                </xsl:if>
                <p class="p8">
                  <a class="link2" href="{umbraco.library:NiceUrl($highlightContent/@id)}">
                    <xsl:value-of select="$highlightContent/contentTitle"/>
                  </a>
                  <br/>
                  <xsl:value-of select ="umbraco.library:TruncateString($highlightContent/contentBody, 400,'...')" disable-output-escaping="yes"></xsl:value-of>
                </p>
                <a class="link3" href="{umbraco.library:NiceUrl($highlightContent/@id)}">Ler Mais >></a>
              </div>
            </article>
          </xsl:for-each>
        </div>
      </div>




      <br />
      <div class="container_12">
        <div class="wrapper">
          <article class="grid_12">
            <h2 class="border1">Novidades</h2>
          </article>
          <!-- NOTICIAS em DESTAWUE e EVENTOS-->
          <xsl:for-each select="$currentPage/descendant::NewsPage">
            <xsl:if test="position()&lt;4">
              <article class="grid_4">
                <div class="page1-box3">
                  <div class="inner1">
                    <time datetime="">
                      <xsl:value-of select="umbraco.library:FormatDateTime(contentDay, 'dd')"/>
                      <span>
                        <xsl:value-of select="umbraco.library:FormatDateTime(contentDay, 'MMM')"/>
                      </span>
                    </time>
                  </div>
                  <div class="extra-wrap-novidades">
                    <a class="link2" href="{umbraco.library:NiceUrl(@id)}">
                      <xsl:value-of select="contentTitle"/>
                    </a>
                    <p>
                      <xsl:value-of select ="umbraco.library:TruncateString(contentSummary, 65,'...')" disable-output-escaping="yes"></xsl:value-of>
                    </p>
                  </div>
                </div>
              </article>
            </xsl:if>
          </xsl:for-each>
        </div>
      </div>
    </section>
  </xsl:template>

</xsl:stylesheet>